<?php
require_once("vcl/vcl.inc.php");
require_once("lib/db_connection.php");
//Includes
use_unit("forms.inc.php");
use_unit("extctrls.inc.php");
use_unit("stdctrls.inc.php");

//Class definition
class Vehicle_Specification extends Page
{
       public $imgBack = null;
       public $Image1 = null;
       public $btnSubmit = null;
       public $btnCancel = null;
       public $hiddenId = null;
       public $edValue = null;
       public $lblValue = null;
       public $edDesc = null;
       public $lbldesc = null;
       function imgBackJSMouseOut($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgBack'].src="image/btn_back.png"
       <?php

       }

       function imgBackJSMouseOver($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgBack'].src="image/btn_back2.png"
       <?php

       }


       function Vehicle_SpecificationCreate($sender, $params)
       {
       $id = $_GET['veh'];
       $this->hiddenId->setValue($id);

       $this->edDesc->Text="";
       $this->edValue->Text="";

       $this->imgBack->setLink('details_emission.php?layer=2&veh='.$this->hiddenId->getValue());
       }

       function btnCancelClick($sender, $params)
       {
       redirect('details_emission.php?layer=2&veh='.$this->hiddenId->getValue());
       }




       function btnSubmitClick($sender, $params)
       {
       $veh_id = $this->hiddenId->getValue();

       $result = mysql_query("insert into veh_specification_tbl (company_id,
       vehicle_id,
       description,
       quantity)

       values ('".$_SESSION['company_id']."',
       '".$veh_id."',
       '".$this->edDesc->Text."',
       '".$this->edValue->Text."')") or die("INSERT SPECIFICATION - " . mysql_error());

       redirect('details_emission.php?layer=2&veh='.$this->hiddenId->getValue());


       }


}

global $application;

global $Vehicle_Specification;

//Creates the form
$Vehicle_Specification=new Vehicle_Specification($application);

//Read from resource file
$Vehicle_Specification->loadResource(__FILE__);

//Shows the form
$Vehicle_Specification->show();

?>